﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TasksModel
{
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://mp.tasks.com/2010/")]
    public class TaskTagList : List<string>
    {
        public TaskTagList()
        {
        }

        public TaskTagList(TaskTagList list)
            : base(list)
        {
        }

        public string ToCommaList()
        {
            if (Count == 0)
                return string.Empty;
            StringBuilder sb = new StringBuilder(Count * 5);
            foreach (string tag in this)
            {
                if (sb.Length > 0)
                    sb.Append(", ");
                sb.Append(tag);
            }
            return sb.ToString();
        }
    }
}